//package com.hq.xmind;
//
//import org.xmind.core.*;
//
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.List;
//
//
//public class SpringBootXmindApplicationTestsBak {
//
//    public static void main(String[] args) {
//        IWorkbookBuilder builder = Core.getWorkbookBuilder();//初始化builder
//        IWorkbook workbook = null;
//        try {
//            String path = "D:\\SpringBoot\\SpringBoot-Xmind\\file\\java.xmind";
//            workbook = builder.loadFromPath(path);//打开XMind文件
//        } catch (IOException e) {
//            e.printStackTrace();
//        } catch (CoreException e) {
//            e.printStackTrace();
//        }
//        ISheet defSheet = workbook.getPrimarySheet();//获取主Sheet
//        ITopic rootTopic = defSheet.getRootTopic();//获取根Topic
//
////        System.out.println(rootTopic);
//        List<ITopic> allChildren = rootTopic.getAllChildren();
//
//        treeTopicList(allChildren,0);
////        System.out.println(treeList);
//        for (Tree tree:treeList) {
//            System.out.println(tree);
//        }
//    }
//
//
//    //子节点
//    static List<ITopic> childTopic = new ArrayList<ITopic>();
//    static List<Tree> treeList = new ArrayList<>();
//
//
//    public static List<Tree> treeTopicList(List<ITopic> allChildren, int level) {
//
//        for ( ITopic topic: allChildren ) {
////            System.out.println(level+"-"+topic.getTitleText()+",id="+topic.getId()+",pid="+topic.getParent().getId());
////            System.out.println("topic.isFolded()="+topic.getParent().getId()+"="+topic);
//            Tree tree = new Tree();
//            tree.setId(topic.getId());
//            tree.setPid(topic.getParent().getId());
//            tree.setLevel(level);
//            tree.setTitle(topic.getTitleText());
//            treeList.add(tree);
//            List<ITopic> childrenList = topic.getAllChildren();
//            if(childrenList.size()>0){
////                childTopic.add(topic);
//                treeTopicList(childrenList, level+1);
//
//            }
//        }
//        return treeList;
//    }
//}
